﻿using Microsoft.AspNetCore.SignalR;
using SignalRSample.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SignalRSample.Hubs
{
    public class TestHub
        : Hub<IHubClient>
    {
        public override Task OnConnectedAsync()
        {
            return base.OnConnectedAsync();
        }
        public override Task OnDisconnectedAsync(Exception exception)
        {
            return base.OnDisconnectedAsync(exception);
        }
        public async Task SendMessageAsync(string userName, string msg)
        {
            var id = Context.ConnectionId;
            var str = Context.GetHttpContext().Request.QueryString;
            var features = Context.Features;
            var user = Context.User;
            var identity = Context.UserIdentifier;
            await Clients.All.SayHelloAsync(id, msg);
        }
    }
}
